home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1997 February: Technology Seed / Mac Tech Seed Feb '97.toast / ODF Release 3 / ODFDev / Clock / Sources / Frame.h < prev    next >
Encoding:
Text File  |  1996-12-16  |  3.2 KB  |  108 lines  |  [TEXT/MPS ]

  1. //========================================================================================
  2. //
  3. //    File:                Frame.h
  4. //    Release Version:    $ ODF 3 $
  5. //
  6. //    Copyright:    (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
  7. //
  8. //========================================================================================
  9.  
  10. #ifndef FRAME_H
  11. #define FRAME_H
  12.  
  13. #ifndef FWFRAME_H
  14. #include "FWFrame.h"
  15. #endif
  16.  
  17. #ifndef FWSTRING_H
  18. #include "FWString.h"
  19. #endif
  20.  
  21. #ifndef FWCOLOR_H
  22. #include "FWColor.h"
  23. #endif
  24.  
  25. #ifndef FWRECT_H
  26. #include "FWRect.h"
  27. #endif
  28.  
  29. #ifndef FWMAPING_H
  30. #include "FWMaping.h"
  31. #endif
  32.  
  33. //========================================================================================
  34. // Classes used by this interface
  35. //========================================================================================
  36.  
  37. class FW_CTime;
  38. class CClockPart;
  39. class CClockContent;
  40. class FW_CGraphicContext;
  41. class CClockView;
  42.  
  43. //========================================================================================
  44. //    Defines
  45. //========================================================================================
  46.  
  47. #define kBackgroundColorProp        "Apple:Framework:Property:BackgroundColor"
  48. #define kBackgroundColorValue        "Apple:Framework:Value:BackgroundColor"
  49.  
  50. //========================================================================================
  51. // CClockFrame
  52. //========================================================================================
  53.  
  54. class CClockFrame : public FW_CFrame
  55. {
  56. public:
  57.     FW_DECLARE_AUTO(CClockFrame)
  58.  
  59. //----------------------------------------------------------------------------------------
  60. //    Constructor/Destructor
  61. //
  62. public:
  63.     CClockFrame(Environment* ev, ODFrame* odFrame, FW_CPresentation* presentation, CClockPart* clockPart, CClockContent* content);
  64.     virtual ~ CClockFrame();
  65.  
  66. //----------------------------------------------------------------------------------------
  67. //    Inherited API
  68. //
  69. public:
  70.     virtual void        Draw(Environment* ev, ODFacet* odFacet, ODShape* invalidShape);
  71.     virtual void         FacetAdded(Environment* ev, ODFacet* facet, unsigned short facetCount);
  72.     
  73.     virtual ODShape*    AdjustUsedShape(Environment* ev, ODShape* suggestedUsedShape);
  74.     virtual ODShape*    AdjustActiveShape(Environment* ev, ODFacet* facet, ODShape* suggestedActiveShape);
  75.  
  76.     virtual void        PresentationChanged(Environment* ev);
  77.  
  78. //----------------------------------------------------------------------------------------
  79. //    New API
  80. //
  81. public:
  82.     CClockView*            GetClockView(Environment* ev) const;
  83.     CClockContent*        GetClockContent(Environment* ev) const;
  84.     
  85.     void                SetBackgroundColor(Environment* ev, FW_CColor& newColor);
  86.     void                GetBackgroundColor(FW_CColor* newColor) const;
  87. private:    
  88.     virtual void        AdoptContainingPartProperties(Environment* ev, ODStorageUnit* propertyUnit);
  89.     
  90. //----------------------------------------------------------------------------------------
  91. //    Data Members
  92. //
  93. private:
  94.     CClockPart*         fClockPart;
  95.     FW_CColor            fBackgroundColor;
  96.     CClockContent*        fClockContent;
  97. };
  98.  
  99. //----------------------------------------------------------------------------------------
  100. //    CClockFrame::GetClockContent
  101. //----------------------------------------------------------------------------------------
  102. inline CClockContent* CClockFrame::GetClockContent(Environment*) const
  103. {
  104.     return fClockContent;
  105. }
  106.  
  107. #endif
  108.